<template>
  <div>
    <h1>这是后代组件显示的内容</h1>
    <h2>{{name}}---{{age}}</h2>
  </div>
</template>

<script>
import { inject, toRefs } from 'vue'
export default {
  name: 'bbbBBB',
  setup () {
    // 接收祖先组件传入的值
    const obj = inject('obj')
    return {
      ...toRefs(obj)
    }
  }
}
</script>

<style>

</style>
